package java课题设计.功能类.修改学生或者删除学生;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
 
//本类用于修改和删除学生数据(除了学号)
public class ReviseStudent extends JFrame implements MouseListener {
    Font f=new Font("宋体",Font.BOLD,25);
    JButton ReviseStu=new JButton("修改学生信息");
    JButton DelStu=new JButton("删除某个学生");
 
 
    public ReviseStudent() {
        extracted();
        image();
 
        this.setVisible(true);
    }
    public void extracted(){
        this.setSize(488,430);
        this.setTitle("选择查找方式");
        this.setDefaultCloseOperation(3);
        this.setLocationRelativeTo(null);
        this.setLayout(null);
        this.setAlwaysOnTop(true);
 
 
        //绑定监听事件
        DelStu.addMouseListener(this);
        ReviseStu.addMouseListener(this);
    }
    public void image(){
        //添加"修改学生信息"按钮
        ReviseStu.setBounds(116,80,247,80);
        ReviseStu.setFont(f);
        this.getContentPane().add(ReviseStu);
 
        //添加"删除学生"按钮
        DelStu.setBounds(116,215,247,80);
        DelStu.setFont(f);
        this.getContentPane().add(DelStu);
 
    }
 
 
    @Override
    public void mouseClicked(MouseEvent e) {
        if(e.getSource()==ReviseStu){
            System.out.println("点击了修改学生信息");
            //调用修改学生类
            new StudentID();
            this.setVisible(false);
        }
        else if(e.getSource()==DelStu){
            System.out.println("点击了删除学生按钮");
            //调用删除类
            new DelID();
            this.setVisible(false);
        }
    }
 
    @Override
    public void mousePressed(MouseEvent e) {
 
    }
 
    @Override
    public void mouseReleased(MouseEvent e) {
 
    }
 
    @Override
    public void mouseEntered(MouseEvent e) {
 
    }
 
    @Override
    public void mouseExited(MouseEvent e) {
 
    }
}
